import type { menuListType } from '@/store/types';
export function getMenuLeafKeys(data: menuListType[]) {
  const leafKeys: number[] = [];
  const recurseGetLeaf = (data: menuListType[]) => {
    for (const item of data) {
      if (item.children) {
        recurseGetLeaf(item.children);
      } else {
        leafKeys.push(item.id);
      }
    }
  };
  recurseGetLeaf(data);
  return leafKeys;
}
